package com.sunday.common.sharding.sphere.jdbc;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.sunday.common.core.gson.GsonUtils;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @Description: 订单子项表
 * @author: zsy
 * @Create: 2023/08/07 09:29:45
 */
@Data
@TableName("sunday_order_item")
public class OrderItem implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId("id")
    private Long id;

    /**
     * 订单ID
     */
    @TableField("order_header_id")
    private Long orderHeaderId;

    /**
     * 数量
     */
    @TableField("quantity")
    private Integer quantity;

    /**
     * 折扣价
     */
    @TableField("discount_price")
    private BigDecimal discountPrice;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;


    @Override
    public String toString() {
        return GsonUtils.DEFAULT.toJson(this);
    }
}
